import { createStore } from 'vuex';

const store = createStore({
    state:{
        searchList: [],
        notLogin: false
      },
    mutations:{
        setSearchList(state,searchList){
            state.searchList = searchList
        },
        setNotLogin(state,notLogin){
            state.notLogin = notLogin
        }
    },
    actions:{
        updateSearchList({commit},searchList){
          commit('setSearchList',searchList)
        },
        updateNotLogin({commit},notLogin){
          commit('setNotLogin',notLogin)
        }
    },
    getters:{
        getSearchList: (state) => state.searchList,
        getNotLogin: (state) => state.notLogin
    }
});

export default store;
